<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">


<body>
	<ui:composition template="/template/template.xhtml">
		<ui:define name="body">										
			<h:form onkeypress="if (event.keyCode == 13) return false;">
								
				<rich:notifyMessages stayTime="5000" nonblocking="true" />														              			
				
											
					<rich:panel header="#{msg.log_report}">
						<table>
						
							<tr>
								<td>
									<h:outputText value="#{msg.building_name}" styleClass="outputText" style="font-size: 16px;" />
								</td>
								
								<td>
									<h:selectOneMenu 
										id="search_building_name" styleClass="selectClass" 
										value="#{mainDataAuditLogBean.selectedBuildingId}" valueChangeListener="#{mainDataAuditLogBean.buildingValueChanged}" >
										<f:selectItems value="#{mainDataAuditLogBean.buildingOptions}" />
										<a4j:ajax event="valueChange" render="search_floor_name,search_room_name,search_machine_name" execute="@this" />
		
									</h:selectOneMenu>
								</td>
							
							</tr>
							
							<tr>
								<td>
									<h:outputText value="#{msg.floor_name}" styleClass="outputText" style="font-size: 16px;" />
								</td>
								
								<td>
									<h:selectOneMenu 
										id="search_floor_name" styleClass="selectClass" 
										value="#{mainDataAuditLogBean.selectedFloorId}" valueChangeListener="#{mainDataAuditLogBean.floorValueChanged}" >
										<f:selectItems value="#{mainDataAuditLogBean.floorOptions}" />
										<a4j:ajax event="valueChange" render="search_room_name,search_machine_name" execute="@this" />
									</h:selectOneMenu>
								</td>
							</tr>
							
							<tr>
								<td>
									<h:outputText value="#{msg.room_name}" styleClass="outputText" style="font-size: 16px;" />
								</td>
								<td>
									<h:selectOneMenu 
										id="search_room_name" styleClass="selectClass" 
										value="#{mainDataAuditLogBean.selectedRoomId}" valueChangeListener="#{mainDataAuditLogBean.roomValueChanged}" >
										<f:selectItems value="#{mainDataAuditLogBean.roomOptions}" />
										<a4j:ajax event="valueChange" render="send_btn,search_machine_name" execute="@this" />
									</h:selectOneMenu>
								</td>
							</tr>
							
							<tr>
								<td><h:outputText value="#{msg.machine_name}" styleClass="outputText" style="font-size: 16px;" /></td>
								<td>
									<h:selectOneMenu id="search_machine_name" styleClass="selectClass" 
										value="#{mainDataAuditLogBean.selectedMachineId}">
										
										<f:selectItems value="#{mainDataAuditLogBean.machineOptions}" />
																															
									</h:selectOneMenu>									
								</td>	
																														
							</tr>
							<tr>
								<td><h:outputText value="#{msg.from_date}" styleClass="outputText" style="font-size: 16px;" /></td>
								<td>
									<rich:calendar id="search_fromDate" value="#{mainDataAuditLogBean.searchFromDate}" 										
                    					cellWidth="400px" cellHeight="40px" style="width:300px" />                
								</td>
							</tr>
							<tr>
								
								<td><h:outputText value="#{msg.to_date}" styleClass="outputText" style="font-size: 16px;" /></td>
								<td>
									<rich:calendar id="search_toDate" value="#{mainDataAuditLogBean.searchToDate}" 										
                    					cellWidth="400px" cellHeight="40px" style="width:300px" />                
								</td>
							</tr>
							
							<tr>
								<td><h:outputText value="#{msg.audited_by}" styleClass="outputText" style="font-size: 16px;" /></td>
								<td>
									<h:selectOneMenu id="search_audited_name" styleClass="selectClass" 
										value="#{mainDataAuditLogBean.searchAuditUserId}" >										
										<f:selectItems value="#{mainDataAuditLogBean.auditUsers}" />																									
									</h:selectOneMenu>
								</td>
							</tr>							 		
							
							<tr>
								<td colspan="2" align="left">
									
									<h:commandButton styleClass="buttonClass" style="font-size: 16px;" 
										value="#{msg.excel}" 
										actionListener="#{mainDataAuditLogBean.genExcel}" />
								</td>

							</tr>
						</table>
					</rich:panel>	
									

			</h:form>						
			    
		</ui:define>
	</ui:composition>
</body>
</html>
